home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 5464 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: rcp6.elan.af.mil!rscernix!danpop
  2. Newsgroups: comp.lang.c
  3. Subject: Re: Error: FILE *rl_instream = stdin; initializer is not a constant
  4. Message-ID: <danpop.823804447@rscernix>
  5. From: danpop@mail.cern.ch (Dan Pop)
  6. Date: 8 Feb 96 18:34:07 GMT
  7. References: <4fbenh$60s@news1.sympatico.ca>
  8. Organization: Air Force Flight Test Center
  9. NNTP-Posting-Host: ues5.cern.ch
  10. X-Newsreader: NN version 6.5.0 #7 (NOV)
  11.  
  12. In <4fbenh$60s@news1.sympatico.ca> Stephane Lajeunesse <slajeunesse@sympatico.ca> writes:
  13.  
  14. >When I'm comiling this using GCC 2.5.8 on Xenix, this type of 
  15. >initialization doesn't work:
  16. >
  17. >FILE *rl_inputstream = stdin;
  18. >
  19. >It halts with a message :
  20. >
  21. >initializer is not a constant
  22.  
  23. If the declaration has file scope, it doesn't have to work, because
  24. stdin is not required to be a constant expression.
  25.  
  26. >Any ideas on how I can work around this problem.
  27.  
  28. Initialize rl_inputstream in main (this is where global variables are 
  29. supposed to be initialized, when they cannot be initialized at the same
  30. place they're defined).
  31.  
  32. Dan
  33. --
  34. Dan Pop
  35. CERN, CN Division
  36. Email: danpop@mail.cern.ch 
  37. Mail:  CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
  38.